package pub.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Userlogin entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "userlogin", catalog = "sddf")
public class Userlogin implements java.io.Serializable {

	// Fields

	private String name;
	private Uerinfo uerinfo;
	private String password;
	private Integer state;

	// Constructors

	/** default constructor */
	public Userlogin() {
	}

	/** minimal constructor */
	public Userlogin(String name, String password, Integer state) {
		this.name = name;
		this.password = password;
		this.state = state;
	}

	/** full constructor */
	public Userlogin(String name, Uerinfo uerinfo, String password, Integer state) {
		this.name = name;
		this.uerinfo = uerinfo;
		this.password = password;
		this.state = state;
	}

	// Property accessors
	@Id
	@Column(name = "name", unique = true, nullable = false, length = 20)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "userId")
	public Uerinfo getUerinfo() {
		return this.uerinfo;
	}

	public void setUerinfo(Uerinfo uerinfo) {
		this.uerinfo = uerinfo;
	}

	@Column(name = "password", nullable = false, length = 20)
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "state", nullable = false)
	public Integer getState() {
		return this.state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

}